<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>销售统计</title>
    <!-- Bootstrap -->
    <link href="/shop/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- 日期控件 -->
    <link href="https://cdn.bootcss.com/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker3.min.css" rel="stylesheet">
    <style>
        /* 添加必要的样式，让内容显示过长时出现垂直滚动条 */
        .modal-dialog {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
        }

        .modal-content {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }

        .modal-body {
            overflow-y: scroll;
            position: absolute;
            top: 55px;
            bottom: 65px;
            width: 100%;
        }

        .modal-header .close {
            margin-right: 15px;
        }

        .modal-footer {
            position: absolute;
            width: 100%;
            bottom: 0;
        }

        /* 头部样式 */
        .sales-header {
            margin-top: 2em;
        }


        #modal-tbody-saildetail td {
            width: 150px !important;
        }

        .inline-block {
            display: inline-block;
        }
    </style>
</head>
<body>

<div class="container sales-header">
    <!-- Button trigger modal -->
    <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        查询
    </button>

    <form action="/statistics/salesExcelExport" method="post" class="inline-block">
        <button type="submit" class="btn btn-primary btn-lg">
            导出
        </button>
    </form>


    <br><br>

    <table class="table table-responsive table-hover table-bordered datas" style="display: none;"></table>
</div>


<!-- search-Modal Start -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                <h4 class="modal-title" id="myModalLabel">查询条件</h4>
            </div>
            <div class="modal-body">
                <form id="updateform" method="post">

                    <div class="form-group">
                        <label>销售起始日期：</label>
                        <div class='input-group date' id='start_salesdate'>
                            <input type='text' class="form-control" readonly name="start_salesdate" value="2019-02-20"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-calendar"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label>销售截止日期：</label>
                        <div class='input-group date' id='end_salesdate'>
                            <input type='text' class="form-control" readonly name="end_salesdate"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-calendar"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="email" class="control-label">国际码:</label>
                        <input type="text" class="form-control" id="wordcode" name="wordcode">
                    </div>

                    <div class="form-group">
                        <label for="brandid" class="control-label">品牌:</label>
                        <div class='input-group date' id='brandid-div'>
                            <input type='text' class="form-control" readonly name="brandid" id="brandid"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-search span-brandid"
                                      onclick="selectButtons('brandid')"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="saleportid" class="control-label">销售端口:</label>
                        <div class='input-group date' id='saleportid-div'>
                            <input type='text' class="form-control" readonly name="saleportid" id="saleportid"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-search span-saleportid"
                                      onclick="selectButtons('saleportid')"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="brandgroupid" class="control-label">品类:</label>
                        <div class='input-group date' id='brandgroupid-div'>
                            <input type='text' class="form-control" readonly name="brandgroupid" id="brandgroupid"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-search span-brandgroupid"
                                      onclick="selectButtons('brandgroupid')"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="departmentid" class="control-label">部门:</label>
                        <select name="departmentid" id="departmentid" class="form-control"></select>
                    </div>

                    <div class="form-group">
                        <label for="ageseasonid" class="control-label">年代季节:</label>
                        <select name="ageseasonid" id="ageseasonid" class="form-control"></select>
                    </div>

                    <div class="form-group">
                        <label for="memberid" class="control-label">会员:</label>
                        <div class='input-group date' id='memberid-div'>
                            <input type='text' class="form-control" readonly name="memberid" id="memberid"/>
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-search span-memberid"
                                      onclick="selectButtons('memberid')"></span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="genderid" class="control-label">性别:</label>
                        <select name="genderid" id="genderid" class="form-control">
                            <option value="" selected>== 请选择 ==</option>
                            <option value="0">女士</option>
                            <option value="1">男士</option>
                            <option value="2">中性</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="rateby" class="control-label">比例依据:</label>
                        <select name="rateby" id="rateby" class="form-control">
                            <option value="1" selected>件数</option>
                            <option value="2">利润</option>
                            <option value="3">实收金额</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="groupby" class="control-label">分组依据:</label>
                        <select name="groupby" id="groupby" class="form-control">
                            <option value="1" selected>按品牌</option>
                            <option value="2">按销售端口</option>
                            <option value="3">按品类</option>
                            <option value="4">按部门</option>
                            <option value="5">按会员</option>
                            <option value="6">按入库时间</option>
                            <option value="7">按销售人</option>
                        </select>
                    </div>

                    <div class="text-right">
                        <span id="returnMessage" class="glyphicon"> </span>
                        <button type="button" class="btn btn-default right" data-dismiss="modal">关闭</button>
                        <button id="submitBtn" type="button" class="btn btn-primary" onclick="add_info()">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- search-Modal End -->

<!-- brand-Modal Start -->
<div class="modal fade" id="modal-brandid" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title" id="myModalBrandid">请选择品牌：</h4>
            </div>
            <div class="modal-body" id="modal-body-brandid">
                <div class="bs-example" data-example-id="hoverable-table">
                    <table class="table table-hover" id="btable-brandid">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>名称</th>
                        </tr>
                        </thead>
                        <tbody id="modal-tbody-brandid"></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="confirmButtons('brandid')">
                    确认
                </button>
            </div>
        </div>
    </div>
</div>
<!-- brand-Modal End -->

<!-- saleportid-Modal Start -->
<div class="modal fade" id="modal-saleportid" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title" id="myModalSaleportid">请选择销售端口：</h4>
            </div>
            <div class="modal-body" id="modal-body-saleportid">
                <div class="bs-example" data-example-id="hoverable-table">
                    <table class="table table-hover" id="btable-saleportid">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>名称</th>
                        </tr>
                        </thead>
                        <tbody id="modal-tbody-saleportid"></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary"
                        onclick="confirmButtons('saleportid')">确认
                </button>
            </div>
        </div>
    </div>
</div>
<!-- saleportid-Modal End -->

<!-- brandgroupid-Modal Start -->
<div class="modal fade" id="modal-brandgroupid" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title" id="myModalbrandgroupid">请选择品类：</h4>
            </div>
            <div class="modal-body" id="modal-body-brandgroupid">
                <div class="bs-example" data-example-id="hoverable-table">
                    <table class="table table-hover" id="btable-brandgroupid">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>名称</th>
                        </tr>
                        </thead>
                        <tbody id="modal-tbody-brandgroupid"></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary"
                        onclick="confirmButtons('brandgroupid')">确认
                </button>
            </div>
        </div>
    </div>
</div>
<!-- brandgroupid-Modal End -->

<!-- memberid-Modal Start -->
<div class="modal fade" id="modal-memberid" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title" id="myModalmemberid">请选择会员：</h4>
            </div>
            <div class="modal-body" id="modal-body-memberid">
                <div class="bs-example" data-example-id="hoverable-table">
                    <table class="table table-hover" id="btable-memberid">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>名称</th>
                        </tr>
                        </thead>
                        <tbody id="modal-tbody-memberid"></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal"><?php echo $this->obj->getValidateMessage('button-cancel'); ?></button>
                <button type="button" class="btn btn-primary"
                        onclick="confirmButtons('memberid')">确认
                </button>
            </div>
        </div>
    </div>
</div>
<!-- memberid-Modal End -->

<!-- saildetail-Modal Start -->
<div class="modal fade" id="modal-saildetail" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 680px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title" id="myModalsaildetail">销售详情：

                    <form action="/statistics/salesdetailsExcelExport" method="post" class="inline-block">
                        <input type="hidden" name="datas-details" id="datas-details">
                        <button type="submit" class="btn btn-primary btn-sm" id="export-details">
                            导出
                        </button>
                    </form>

                </h4>
            </div>
            <div class="modal-body" id="modal-body-saildetail">
                <div class="bs-example table-responsive" data-example-id="hoverable-table">
                    <table class="table table-hover text-nowrap table-bordered" id="btable-saildetail">
                        <thead>
                        <tr>
                            <th>&nbsp;</th>
                            <th>销售时间</th>
                            <th>会员</th>
                            <th>国际码</th>
                            <th>商品名称</th>
                            <th>系列</th>
                            <th>年代</th>
                            <th>入库时</th>
                            <th>销售类型</th>
                            <th>尺码</th>
                            <th>数量</th>
                            <th>端口售价</th>
                            <th>折扣</th>
                            <th>折后单价</th>
                            <th>实收金额</th>
                            <th>汇率</th>
                            <th>本币余额</th>
                            <th>成本</th>
                            <th>毛利率</th>
                            <th>本币利润</th>
                            <th>销售端口</th>
                            <th>销售人员</th>
                            <th>制单人</th>
                            <th>销售单号</th>
                            <th>对账单号</th>
                            <th>回款日期</th>
                            <th>是否回款</th>
                            <th>备注</th>
                            <th>注册店铺</th>
                            <th>建立人</th>
                            <th>销售单状态</th>
                            <th>发货日期</th>
                            <th>快递单号</th>
                        </tr>
                        </thead>
                        <tbody id="modal-tbody-saildetail"></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- saildetail-Modal End -->

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="/shop/assets/plugins/jquery.min.js" type="text/javascript"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="/shop/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- 日期控件js -->
<script src="https://cdn.bootcss.com/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-datepicker/1.8.0/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<!-- 加入layer实现简易弹窗 -->
<script src="/shop/assets/static/js/layer_mobile/layer.js"></script>
<!-- 自定义js -->
<script src="/shop/assets/custom/statistics.js" type="text/javascript"></script>
</body>
</html>